package com.aop.example.mapper;

import com.aop.example.pojo.Permission;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PermissionMapper extends BaseMapper<Permission> {
    @Select("select perms from permission where permission_id in (" +
            "select permission_id from role_permission where role_id = #{userId}) " +
            "and perms is not null")
    List<String> getPermissionListByUserId(Integer userId);
}
